<?php

use think\migration\Migrator;
use think\migration\db\Column;

class InsertTableAdmin extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
     *
     * The following commands can be used in this method and Phinx will
     * automatically reverse them when rolling back:
     *
     *    createTable
     *    renameTable
     *    addColumn
     *    renameColumn
     *    addIndex
     *    addForeignKey
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function up()
    {
        $this->execute("INSERT INTO `f_admin` (`username`,
        `password`,
        `salt`,
        `role`,
        `email`,
        `mobile`,
        `department`,
        `lastlogin_time`,
        `avatar`,
        `truename`,
        `area`,
        `status`,
        `creator`,
        `create_time`,
        `update_time`)
        VALUES ('admin','22f3948bfc258d52b5311ee04f1219a3','4QNVPe','super-admin','makeup1123@163.com','13707011597',NULL,NULL,'https://cdn.vuetifyjs.com/images/parallax/material.jpg','libing',NULL,'normal',NULL,1574323142,1576202727);");
    }
    public function down()
    {
        $this->execute("delete from `f_admin` where username ='admin';");
    }
}
